package com.yuzhenxin.bookstore.web.servlet;

import com.yuzhenxin.bookstore.service.CategoryService;
import com.yuzhenxin.bookstore.tools.servlet.BaseServlet;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServletRequest;

@WebServlet("/CategoryServlet")
public class CategoryServlet extends BaseServlet {

    private final CategoryService categoryService = new CategoryService();

    /**
     * 查询所有分类
     */
    public String findAll(HttpServletRequest request) {
        request.setAttribute("categoryList", categoryService.findAll());
        return "f:/jsps/left.jsp";
    }
}
